package com.make.house.api.controller;

import com.make.house.api.common.ECConstant;
import com.make.house.api.model.ActionStatus;
import com.make.house.api.model.JSONResult;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by xujun on 2017/11/26.
 * 错误的请求拦截
 */
@RestController
@RequestMapping(ECConstant.API_REQUEST_BASE_URL+"/error")
public class BaseErrorController implements ErrorController {
    @Override
    public String getErrorPath() {
        return new JSONResult(ActionStatus.REQUEST_TYPE_ERROR.inValue(), ActionStatus.REQUEST_TYPE_ERROR.getDescription(), "").toString();
    }
}
